33 research outputs found

    Canonical Abstract Syntax Trees

    Get PDF
    This paper presents Gom, a language for describing abstract syntax trees and generating a Java implementation for those trees. Gom includes features allowing the user to specify and modify the interface of the data structure. These features provide in particular the capability to maintain the internal representation of data in canonical form with respect to a rewrite system. This explicitly guarantees that the client program only manipulates normal forms for this rewrite system, a feature which is only implicitly used in many implementations

    Formal Validation of Pattern Matching code

    Get PDF
    When addressing the formal validation of generated software, two main alternatives consist either to prove the correctness of compilers or to directly validate the generated code. Here, we focus on directly proving the correctness of compiled code issued from powerful pattern matching constructions typical of ML like languages or rewrite based languages such as ELAN, MAUDE or Tom. In this context, our first contribution is to define a general framework for anchoring algebraic pattern-matching capabilities in existing languages like C, Java or ML. Then, using a just enough powerful intermediate language, we formalize the behavior of compiled code and define the correctness of compiled code with respect to pattern-matching behavior. This allows us to prove the equivalence of compiled code correctness with a generic first-order proposition whose proof could be achieved via a proof assistant or an automated theorem prover. We then extend these results to the multi-match situation characteristic of the ML like languages. The whole approach has been implemented on top of the Tom compiler and used to validate the syntactic matching code of the Tom compiler itself

    Rules and Strategies in Java

    Get PDF
    International audienceIn this paper we present the essential feature we have considered when designing a new language based on rules and strategies. Relying on the implementation of Tom, we explain how these ingredients can be implemented and integrated in a Java environment

    Rewriting Strategies in Java

    Get PDF
    International audienceIn any language designed to express transformations, the notion of rewrite rule is a key feature. Its conciseness as well as its strong theoretical foundations are essential. The notion of strategy is complementary: this describes how rules are applied. In this paper, we show how a high-level strategy language can be implemented in a Java setting. We present the integration of the visitor combinator design pattern into Tom. This corresponds to an interpreter for strategy expressions. To be more efficient, we present a compilation method based on bytecode specialization. This low-level transformation is expressed in Tom itself, using rules and strategies

    Tom Manual

    Get PDF
    This manual contains information for Tom version 2.7. Tom is a language extension which adds new matching primitives to languages like C, Java, and Caml. Although rich and complex, Tom is not a stand-alone language: like a preprocessor, it strongly relies on the underlying language (C, Java, or Caml), called host-language in the following. To this language, Tom adds several constructs. The main construct, %match, is similar to the match primitive found in functional languages: given an object (called subject) and a list of patterns-actions, the match primitive selects the first pattern that matches the subject and performs the associated action. The sub ject against which we match can be any object, but in practice, this ob ject is usually a tree-based data-structure, also called term in the algebraic programming community. The match construct may be seen as an extension of the classical switch/case construct. The main difference is that the discrimination occurs on a term and not on atomic values like characters or integers: the patterns are used to discriminate and retrieve information from an algebraic data structure. There- fore, Tom is a good language for programming by pattern matching, and it is particularly well-suited for programming various transformations on trees/terms or Xml data-structures

    Rewriting and trustworthy compilation

    No full text
    La plupart des processus informatiques mettent en jeu la notion de transformation, en particulier la compilation. Nous nous intéressons dans cette thèse à fournir des outils et des méthodes, utilisant la réécriture, permettant d'accroître la confiance que l'on peut placer dans ces processus. Nous développons dans un premier temps un cadre permettant de valider la compilation de constructions de filtrage, produisant une preuve formelle de la validité de la compilation, ainsi qu'un témoin de cette preuve, à chaque exécution du compilateur. Afin de permettre l'écriture sûre de transformations complexes, nous proposons un générateur de structures de données efficaces intégrant des invariants algébriques, et un langage de stratégies permettant de contrôler l'application des transformations. Ces résultats constituent donc une avancée vers la constitution de methodes génériques sûres pour le développement de transformations de confiance.Most computer processes involve the notion of transformation, in particular the compilation processes. We interest in this thesis in providing tools and methods, based on rewriting, giving the opportunity to increase the confidence we can place into those processes. We develop first a framework used to validate the compilation of matching constructs, building a formal proof of the validity of the compilation process along with a witness of this proof, for each run of the compiler. Then, in order to allow one to write safely complex transformations, we propose a tool that generates an efficient data structure integrating algebraic invariants, as well as a strategy language that enables to control the application of transformations. Those results can be seen as a first step towards the constitution of generic and safe methods for the development of trustworthy transformations

    Réécriture et compilation de confiance

    No full text
    Most computer processes involve the notion of transformation, in particular the compilation processes. We interest in this thesis in providing tools and methods, based on rewriting, giving the opportunity to increase the confidence we can place into those processes. We develop first a framework used to validate the compilation of matching constructs, building a formal proof of the validity of the compilation process along with a witness of this proof, for each run of the compiler. Then, in order to allow one to write safely complex transformations, we propose a tool that generates an efficient data structure integrating algebraic invariants, as well as a strategy language that enables to control the application of transformations. Those results can be seen as a first step towards the constitution of generic and safe methods for the development of trustworthy transformations.La plupart des processus informatiques mettent en jeu la notion de transformation, en particulier la compilation. Nous nous intéressons dans cette thèse à fournir des outils et des méthodes, utilisant la réécriture, permettant d'accroître la confiance que l'on peut placer dans ces processus. Nous développons dans un premier temps un cadre permettant de valider la compilation de constructions de filtrage, produisant une preuve formelle de la validité de la compilation, ainsi qu'un témoin de cette preuve, à chaque exécution du compilateur. Afin de permettre l'écriture sûre de transformations complexes, nous proposons un générateur de structures de données efficaces intégrant des invariants algébriques, et un langage de stratégies permettant de contrôler l'application des transformations. Ces résultats constituent donc une avancée vers la constitution de méthodes génériques sûres pour le développement de transformations de confiance

    Réécriture et compilation de confiance

    No full text
    Most computer processes involve the notion of transformation, in particular the compilation processes. We interest in this thesis in providing tools and methods, based on rewriting, giving the opportunity to increase the confidence we can place into those processes. We develop first a framework used to validate the compilation of matching constructs, building a formal proof of the validity of the compilation process along with a witness of this proof, for each run of the compiler. Then, in order to allow one to write safely complex transformations, we propose a tool that generates an efficient data structure integrating algebraic invariants, as well as a strategy language that enables to control the application of transformations. Those results can be seen as a first step towards the constitution of generic and safe methods for the development of trustworthy transformations.La plupart des processus informatiques mettent en jeu la notion de transformation, en particulier la compilation. Nous nous intéressons dans cette thèse à fournir des outils et des méthodes, utilisant la réécriture, permettant d'accroître la confiance que l'on peut placer dans ces processus. Nous développons dans un premier temps un cadre permettant de valider la compilation de constructions de filtrage, produisant une preuve formelle de la validité de la compilation, ainsi qu'un témoin de cette preuve, à chaque exécution du compilateur. Afin de permettre l'écriture sûre de transformations complexes, nous proposons un générateur de structures de données efficaces intégrant des invariants algébriques, et un langage de stratégies permettant de contrôler l'application des transformations. Ces résultats constituent donc une avancée vers la constitution de méthodes génériques sûres pour le développement de transformations de confiance

    Réécriture dans un cadre concurrent

    No full text
    Stage de DEA. Rapport de stage.Ce document décrit une proposition de système de stratégies permettant la mise en oeuvre de parallélisme pour des systèmes de réécriture avec le système TOM. || This document describes a proposition of a system of strategies using concurrency for rewriting systems in TOM

    Tom illustrated on an implementation of the explicit rewriting calculus

    Get PDF
    Following the experience of Elan [KM01], the Tom [MRV03] language was developed to provide rewrite tools for implementation of calculi, for compilation and for XML-transformations. We will focus here on the former. Tom provides a language to define a syntax (a signature) embedded into Java. Then, we can perform pattern matching with support of associative matching modulo neutral element (also known as list-matching). Finally, we can guide the application of rules with a strategy language defining term traversals (namely evaluation/rewriting strategies). The originality of Tom is the combination of formal aspects with a general purpose language (such as Java). This combination leads to an agile language. At the same time, the strategy language inspired by Elan and Stratego [Vis01] gives the opportunity to reduce the code written in the general purpose language (and thus increase the formal parts). We will illustrate the presentation by an implementation of the explicit rewriting calculus, introduced at the last WRLA [CFK04]. This running example will demonstrate the adequacy of Tom for such a development, offered by the integration in
    corecore